<!DOCTYPE html>
<html lang="zh_CN" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>用户作品</title>
    <link href="./bootstrap-3.3.7-dist/css/bootstrap.min.css" rel=" stylesheet">
    <script src="./js/jquery-3.4.1.min.js"></script>
    <script src="./bootstrap-3.3.7-dist/js/bootstrap.min.js"></script>
    <link href="./css/goods.css" rel=" stylesheet">
    <script src="./js/page.js"></script>
    <style th:include="include/footer :: style"></style>
    <style th:include="include/navstyle :: styletwo"></style>
</head>
<body>
<header>
    <nav th:include="include/navstyle :: nav"></nav>
</header>
<section>
    <div>
        <form action="" id="myForm" method="post" enctype="multipart/form-data">
            <input type="file" name="file" id="file" accept="image/*">
            <input type="submit" value="上传" onclick="upload()" class="btn btn-success">
        </form>
    </div>
    <div class="box">
        <div>
            <a th:href="@{editor}" class="photo" onclick="editor1()"><img th:src="@{${filename0}}" onerror="src='./image/imgbackground.png';" width="100%" height="70%"></a>
            <input type="button" id="btn1" value="修改" onclick="onclickone()"/>
        </div>
        <div>
            <a th:href="@{editor}" class="photo1" onclick="editor2()"><img th:src="@{${filename1}}" onerror="src='./image/imgbackground.png';" width="100%" height="70%"></a>
            <input type="button" id="btn2" value="修改" onclick="onclicktwo()"/>
        </div>
        <div>
            <a th:href="@{editor}" class="photo2" onclick="editor3()"><img th:src="@{${filename2}}" onerror="src='./image/imgbackground.png';" width="100%" height="70%"></a>
            <input type="button" id="btn3" value="修改" onclick="onclickthree()"/>
        </div>
        <div>
            <a th:href="@{editor}" class="photo3" onclick="editor4()"><img th:src="@{${filename3}}" onerror="src='./image/imgbackground.png';" width="100%" height="70%"></a>
            <input type="button" id="btn4" value="修改" onclick="onclickfour()"/>
        </div>
        <div>
            <a th:href="@{editor}" class="photo4" onclick="editor5()"><img th:src="@{${filename4}}" onerror="src='./image/imgbackground.png';" width="100%" height="70%"></a>
            <input type="button" id="btn5" value="修改" onclick="onclickfive()"/>
        </div>
        <div>
            <a th:href="@{editor}" class="photo5" onclick="editor6()"><img th:src="@{${filename5}}" onerror="src='./image/imgbackground.png';" width="100%" height="70%"></a>
            <input type="button" id="btn6" value="修改" onclick="onclicksix()"/>
        </div>
        <div>
            <a th:href="@{editor}" class="photo6" onclick="editor7()"><img th:src="@{${filename6}}" onerror="src='./image/imgbackground.png';" width="100%" height="70%"></a>
            <input type="button" id="btn7" value="修改" onclick="onclickseven()"/>
        </div>
        <div>
            <a th:href="@{editor}" class="photo7" onclick="editor8()"><img th:src="@{${filename7}}" onerror="src='./image/imgbackground.png';" width="100%" height="70%"></a>
            <input type="button" id="btn8" value="修改" onclick="onclickeight()"/>
        </div>
    </div>
</section>
<footer th:include="include/footer :: footer">
</footer>
<script>
    var goodsname1 =  $(".photo").find("img").attr('src');
    var goods1 = goodsname1.replace('/images/rotPhoto/caidao/','');
    console.log(goods1);
    if (goods1 == "null"){
        document.getElementById("btn1").style.display = "none";
    }else {
        document.getElementById("btn1").style.display = "block";
    }
    var goodsname2 =  $(".photo1").find("img").attr('src');
    var goods2 = goodsname2.replace('/images/rotPhoto/caidao/','');
    console.log(goods2);
    if (goods2 == "null"){
        document.getElementById("btn2").style.display = "none";
    }else {
        document.getElementById("btn2").style.display = "block";
    }
    var goodsname3 =  $(".photo2").find("img").attr('src');
    var goods3 = goodsname3.replace('/images/rotPhoto/caidao/','');
    console.log(goods3);
    if (goods3 == "null"){
        document.getElementById("btn3").style.display = "none";
    }else {
        document.getElementById("btn3").style.display = "block";
    }
    var goodsname4 =  $(".photo3").find("img").attr('src');
    var goods4 = goodsname4.replace('/images/rotPhoto/caidao/','');
    console.log(goods4);
    if (goods4 == "null"){
        document.getElementById("btn4").style.display = "none";
    }else {
        document.getElementById("btn4").style.display = "block";
    }
    var goodsname5 =  $(".photo4").find("img").attr('src');
    var goods5 = goodsname5.replace('/images/rotPhoto/caidao/','');
    console.log(goods5);
    if (goods5 == "null"){
        document.getElementById("btn5").style.display = "none";
    }else {
        document.getElementById("btn5").style.display = "block";
    }
    var goodsname6 =  $(".photo5").find("img").attr('src');
    var goods6 = goodsname6.replace('/images/rotPhoto/caidao/','');
    console.log(goods5);
    if (goods6 == "null"){
        document.getElementById("btn6").style.display = "none";
    }else {
        document.getElementById("btn6").style.display = "block";
    }
    var goodsname7 =  $(".photo6").find("img").attr('src');
    var goods7 = goodsname7.replace('/images/rotPhoto/caidao/','');
    console.log(goods7);
    if (goods7 == "null"){
        document.getElementById("btn7").style.display = "none";
    }else {
        document.getElementById("btn7").style.display = "block";
    }
    var goodsname8 =  $(".photo7").find("img").attr('src');
    var goods8 = goodsname8.replace('/images/rotPhoto/caidao/','');
    console.log(goods8);
    if (goods8 == "null"){
        document.getElementById("btn8").style.display = "none";
    }else {
        document.getElementById("btn8").style.display = "block";
    }



</script>
</body>
</html>